<!DOCTYPE html>
<html>
	<head>
	    <title>回收管理</title>
	    <meta charset="UTF-8">
	    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/style.css" />
	    <script type="text/javascript" src="js/jquery.min.js"></script>  
	</head>
<?php
header('content-type:text/html;charset=utf-8');

//身份验证
session_start();
if (!isset($_SESSION['admin'])) {
	header('Refresh:3;url=back_login.html');
	echo "你还没有登陆！";
	die();
}

//获取帖子相关信息
include_once('../dbtools.php');
include_once('../config.php');
	$link=create_connection();
	$sql="select * from huishou";
	$result=mysqli_query($config,$sql);

    
	// $sql="SELECT * FROM huishou ORDER BY huishouid DESC";
	$article=db_getall($link,'school',$sql);

	

    
    


	?>



	<body>
		<form class="form-inline definewidth m20" action="back_hs_search.php" method="post">
			回收物品：<input name="goods" class="abc input-default" placeholder="搜索物品" value=""></input>&nbsp;&nbsp;
			<button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; 
		    <!-- <button type="button" class="btn btn-primary" onclick="location='back_artical_add.html'">添加</button>&nbsp;&nbsp;  -->
		    <font color="red"></font>
		</form>
		<table class="table table-bordered table-hover definewidth m10">
		    <thead>
			    <tr>
							<th>回收单号</th>
			        <th>姓名</th>
			        <th>电话</th>
			        <th>提交用户</th>
			        <th>用户邮箱</th>
			        <th>物品分类</th>

			        <th>物品图片</th>
			        <th>验收地址</th>
			         <th>提交时间</th>
			        <!-- <th>浏览数</th> -->
			        <th style="text-align:center;">操作</th>
			    </tr>
		    </thead>

            <?php 
            while ($ro=mysqli_fetch_array($result)){
            	// var_dump($ro);
            $sql2="SELECT * FROM hs_fenlei WHERE fenlei_id='".$ro['goods_fenlei']."'";
	        $result2=mysqli_query($config,$sql2);
	        while ($ro2=mysqli_fetch_array($result2)){
	        // var_dump($ro2);

            // foreach($article as $k=>$v):
            	?>
			<tr>
				<td><?php echo $ro['huishouid'];?></td> 
				<td><?php echo $ro['name'];?></td>
				<td><?php echo $ro['tel'];?></td>
				<td><?php echo $ro['username'];?></td>
				<td><?php echo $ro['uemail'];?></td>
				<td><?php echo $ro2['fenlei_name'];?></td>

				<td style="width:100px;height: 100px;"><img src="../images/huishou/<?php echo $ro['goods_fenlei'];?>/<?php echo $ro['picture'];?>" style="width: 100%;height: 100%;"></td>
				<td><?php echo $ro['address'];?></td>
				<td><?php echo $ro['pub_time'];?></td>
				<!-- <td><?php echo $v['views'];?></td> -->
				<td style="text-align:center;">
					<!-- <a href="back_artical_edit.php?id=<?php echo $v['id']?>">修改</a>&nbsp;|    -->             
					<a href="back_hs_delete.php?id=<?php echo $ro['huishouid']?>" onclick="return confirm('是否已完成该单子？');">完成</a>&nbsp;
					<!-- <a href="#">查看评论</a>    -->          
				</td>
			</tr>
            <?php 
        }}
        // endforeach;
        ?>

		</table>
	</body>
</html>